<template>
  <a-input ref="inputRef" />
</template>

<script setup>
/**
 * @name 基础输入框组件
 *
 */
import { ref, watch } from 'vue'

const props = defineProps({
  autoFocus: {
    type: Boolean,
    default: false
  },
  autoMark: {
    type: Boolean,
    default: false
  }
})
const inputRef = ref(null)
watch(
  () => props.autoFocus,
  (value) => {
    value && setTimeout(() => inputRef.value.focus(), 10)
    props.autoMark && setTimeout(() => inputRef.value?.setSelectionRange(0, 99), 10)
  }
)
</script>
